home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / autonotify.lha / AutoNotify.br next >
Text File  |  1999-04-04  |  2KB  |  52 lines

  1. /*
  2. $VER: AutoNotify.br 1.0 (3.4.99)
  3. by Neil Bothwick
  4. */
  5. /* ;;; History
  6. Freezes an event before starting the editor, to prevent
  7. unedited mails being sent out
  8.  
  9. 1.0 The first, and hopefully last, version
  10. ;;; */
  11. /* ;;; Initialise */
  12. options results
  13. parse arg SystemName
  14. if ~show('p', 'BBSREAD') then do
  15.     address command
  16.     'run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead'
  17.     'WaitForPort BBSREAD'
  18.     end
  19. if ~show('L','rexxdossupport.library') then do
  20.     if ~addlib('rexxdossupport.library',0,-30,0) then call ExitMsg('Failed to open rexxdossupport.library')
  21.     end
  22. ThorDir = GetVar('THOR/THORPath')
  23. NotifyDir = ThorDir||'autonotify/'
  24. ;;;
  25. /* ;;; Traverse event list */
  26. address BBSREAD
  27. drop SYSTEMDATA.
  28. 'GETBBSDATA "'SystemName'" SYSTEMDATA'
  29. do EventNo = SystemData.FIRSTEVENT to SystemData.LASTEVENT
  30.     drop EventTags.
  31.     READBREVENT '"'SystemName'"' eventnr EventNo tagsstem EventTags
  32.     if exists(NotifyDir||EventTags.TOADDR) then call CreateNotify()
  33.     end
  34. exit
  35. ;;;
  36. /* ;;; Create notify event */
  37. CreateNotify:
  38.     comment = subword(statef(NotifyDir||EventTags.TOADDR),8)
  39.     parse var comment NotifyAddr'|'Subject
  40.     address command ThorDir'rexx/SendMail.br "'SystemName'" EMail' NotifyAddr 'subject "'Subject'" text "'NotifyDir||EventTags.TOADDR'"'
  41.     if RC > 0 then call ExitMsg('Failed to created notification for event' EventNo)
  42.     return
  43. ;;;
  44. /* ;;; Exit with a message */
  45. ExitMsg:
  46.     parse arg msg
  47.     /*address command 'RequestChoice >NIL: "AutoNotify.br" "'msg'" "Continue"'*/
  48.     say msg
  49.     exit
  50. ;;;
  51.  
  52.